<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        body {
            background-color: #EEF8FF;
        }
        
        .bg {
            width: 100%;
            height: 720px;
            background: url(img/bg.jpg) no-repeat;
            background-size: 100% 720px;
            padding-top: 200px;
            margin: 0 auto;
        }
        
        .clock {
            width: 300px;
            height: 300px;
            border-radius: 50%;
            border: 10px solid darkgray;
            background-color: lightgray;
            margin: 0 auto;
            position: relative;
        }
        
        .center,
        .mark {
            border-radius: 50%;
            background-color: darkgray;
            position: absolute;
        }
        
        .mark {
            width: 10px;
            height: 10px;
        }
        
        .twe {
            left: 145px;
            top: 10px;
        }
        
        .thr {
            right: 10px;
            top: 145px;
        }
        
        .six {
            left: 145px;
            bottom: 10px;
        }
        
        .nine {
            left: 10px;
            top: 145px;
        }
        
        .center {
            width: 20px;
            height: 20px;
            left: 140px;
            top: 140px;
        }
        
        .hand {
            position: absolute;
            left: 150px;
            border-radius: 0 50% 50% 0;
            transform-origin: 0;
        }
        
        .hour {
            width: 90px;
            height: 10px;
            background-color: red;
            top: 145px;
        }
        
        .min {
            width: 105px;
            height: 8px;
            background-color: blue;
            top: 146px;
        }
        
        .sec {
            width: 125px;
            height: 6px;
            background-color: darkgray;
            top: 147px;
        }
        
        .weekday {
            width: 150px;
            height: 20px;
            position: absolute;
            bottom: -50px;
            left: 75px;
            text-align: center;
        }
        
        .weekday span {
            margin: 3px;
            background-color: darkgray;
            padding: 3px;
        }
        
        .time {
            width: 66px;
            height: 20px;
            position: absolute;
            bottom: 40px;
            left: 117px;
            background-color: white;
        }
    </style>
</head>

<body>
    <div class="bg w">
        <div class="clock">
            <div class="mark twe"></div>
            <div class="mark thr"></div>
            <div class="mark six"></div>
            <div class="mark nine"></div>
            <div class="weekday"><span>05</span><span>日</span></div>
            <div class="time">23:59:59</div>
            <div class="hand hour"></div>
            <div class="hand min"></div>
            <div class="hand sec"></div>
            <div class="center"></div>
        </div>
    </div>
    <script>
        var hands = document.getElementsByClassName("hand");
        var weekday = document.getElementsByClassName("weekend")[0];
        var dayspan = document.getElementsByTagName("span")[0];
        var weekspan = document.getElementsByTagName("span")[1];
        var time = document.getElementsByClassName("time")[0];
        var clock = function() {
            var timeNow = new Date();
            var month = timeNow.getMonth() + 1;
            var day = timeNow.getDate();
            var week = timeNow.getDay();
            var weeks = ["星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六"];
            dayspan.innerHTML = format(month) + "/" + format(day);
            weekspan.innerHTML = weeks[week];

            var h = timeNow.getHours();
            var m = timeNow.getMinutes();
            var s = timeNow.getSeconds();

            time.innerHTML = format(h) + ":" + format(m) + ":" + format(s);
            var sRot = s * 6 - 90;
            hands[2].style.transform = "rotate(" + sRot + "deg)";
            var mRot = m * 6 + (s / 10) - 90;
            hands[1].style.transform = "rotate(" + mRot + "deg)";
            var hRot = h * 30 + (m / 2) - 90;
            hands[0].style.transform = "rotate(" + hRot + "deg)";
        }
        setInterval(() => {
            clock()
        }, 1000);

        function format(n) {
            return n > 9 ? n : ('0' + n);
        }
    </script>
</body>

</html>